namespace Sirius.Mapper
{
    using System;
    using System.Collections.Generic;
    using Collections;

    public interface ISingleSet<T>
        where T : new ()
    {
        IList<T> AsList();
        IList<TNew> AsList<TNew>(Func<T, TNew> transformer);

        ICollection<T> AsCollection();
        ICollection<TNew> AsCollection<TNew>(Func<T, TNew> transformer);

        IEnumerable<T> AsEnumerable();
        IEnumerable<TNew> AsEnumerable<TNew>(Func<T, TNew> transformer);

        ILookup<TKey, T> AsLookup<TKey>(Func<T, TKey> keySelector);
        ILookup<TKey, TNew> AsLookup<TKey, TNew>(Func<TNew, TKey> keySelector, Func<T, TNew> transformer);

        IDictionary<TKey, T> AsDictionary<TKey>(Func<T, TKey> keySelector);
        IDictionary<TKey, TNew> AsDictionary<TKey, TNew>(Func<TNew, TKey> keySelector, Func<T, TNew> transformer);

        ITree<T> AsTree<TKey>(Func<T, TKey> keySelector, Func<T, TKey> parentSelector);
        ITree<TNew> AsTree<TKey, TNew>(Func<TNew, TKey> keySelector, Func<TNew, TKey> parentSelector, Func<T, TNew> transformer);
        
        T AsSingle();
        TNew AsSingle<TNew>(Func<T, TNew> transformer);

        IInlineMapping<T> UsingMapping();
        ISingleSet<T> UsingMapping(ITypeMapping<T> typeMapping);
    }
}